package simulation;

import java.util.List;
import util.Vector;



public class ConstantForceWallRepulsion extends WallRepulsion {

	private static final double DEFAULT_COEFFICIENT = 0.02;
	private Vector myForce;

	public ConstantForceWallRepulsion(int WallID){
		this(DEFAULT_COEFFICIENT, WallID);
	}
	public ConstantForceWallRepulsion(double magnitude, int WallID) {
		super(magnitude, WallID);
		myForce = new Vector(getDirection(), getMagnitude());
	}

	@Override
	public void apply(List<Mass> myMasses) {
		if (!isOn()) 
			return;
		for (Mass m : myMasses) {
			m.applyForce(myForce);
		}
	}

}
